<template>
    <div>
              <mu-appbar style="width: 100%;" color="primary" title="找回密码">
              <mu-button icon slot="left" to="/login">
              <mu-icon value="arrow_back"></mu-icon>
              </mu-button>
       </mu-appbar>
         <h2 style="color:#757575;"> 验证个人信息 </h2>
        <mu-container>
        <mu-text-field v-model="username" label="请输入账户名" label-float ></mu-text-field><br/>
        <mu-text-field v-model="phone" label="请输入手机号" label-float  ></mu-text-field><br/>
        <mu-text-field v-model="password" label="设置新密码" label-float  ></mu-text-field><br/>
        </mu-container>
        <mu-button class="demo-button" color="primary" @click="reset()">提交</mu-button>

    </div>
</template>
<script>
import axios from "axios";
import 'muse-ui-message/dist/muse-ui-message.css';
import Message from 'muse-ui-message';
export default {
    data(){
return{
    username:"",
    phone:"",
    password:''
}


    },
    methods:{
        reset(){
            let data={username:this.username,phone:this.phone,password:this.password};
            axios.post('/api/user/foundpsw',{data:data}).then(result=>{
                if(result.data=="信息错误"){
                     Message.alert('信息错误','提示');
                }else if(result.data=="新密码设置成功"){
                    Message.alert('新密码设置成功','提示',);
                }else if(result.data=="新密码设置失败"){
                    Message.alert('新密码设置失败','提示');
                }
            })
        }
    }

}
</script>
<style>

</style>
